package 方法的抽象和逐步求精;

public class Exercise5_3 {

	public static int reverse(int number){
		int remainder;
		int times = 0;
		while(number > 0){
			remainder = number % 10;
			times = times * 10 + remainder; 
			number /= 10;
		}
		return times;
	}
	
	public static boolean isPalindrome(int number){
		if(number == reverse(number))
			return true;
		else
			return false;
		
	}
	
	public static void main(String[] args) {
		int i = reverse(123456789);
		System.out.println(isPalindrome(123321));
	}
}
